package com.dt76.smallloanbackendservice.controller.yaozhao;

import com.dt76.smallloanbackendservice.pojo.yaozhao.UpcomingExpire;
import com.dt76.smallloanbackendservice.service.yaozhao.UpcomingExpireService;
import com.dt76.smallloanbackendservice.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/yaozhao")
public class UpcomingExpireController {

    @Autowired
    private UpcomingExpireService upcomingExpireService;

    @RequestMapping("/qryAll")
    @ResponseBody
    public List<UpcomingExpire> qryAll(){
        return upcomingExpireService.qryAll();
    }

    @RequestMapping("/qryPageAll")
    public Page qryPageAll(@RequestParam("pageIndex") int pageIndex,
                           @RequestParam("userName") String userName,
                           @RequestParam("phoneNumber") String phoneNumber,
                           @RequestParam("loanId") String loanId,
                           @RequestParam("ContractId") String ContractId){
        System.out.println("成功调用远程服务:upcomingExpireService>qryPageAll>>>");
        return upcomingExpireService.qryPageAll(pageIndex,userName,phoneNumber,loanId,ContractId);
    }
}
